import { IContextDescriptionItem } from "./interfaces"

export const caseContextDescriptionKeys = {
    caseTitle: '案例名称',
    caseDescription: '案例描述',
    caseDoc: '案例文档',
    caseStatusInfo: '用户当前运行这个案例的状态信息',
    custom: '其他',
}

export const contextDescriptionsToString = (contextDescriptions: IContextDescriptionItem[]) => {
    let res = ''
    contextDescriptions.forEach((item) => {
        const keyStr = caseContextDescriptionKeys[item.key]
        if (!keyStr) {
            return
        }
        res += `## ${caseContextDescriptionKeys[item.key]}\n`
        res += `${item.value}\n\n`
    })
    return res
}

export type CaseContextDescriptionKeys = keyof typeof caseContextDescriptionKeys

export default caseContextDescriptionKeys
